<?php
/*
 * Copyright 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * The Prediction service implementation
 *
 * Generated by http://code.google.com/p/google-api-php-client/
 * Generated from: http://www.googleapis.com/discovery/0.1/describe?api=prediction&apiVersion=v1.1
 **/
class apiPredictionService {

  // Variables that the apiServiceResource implementation depends on
  private $serviceName = 'prediction';
  private $version = 'v1.1';
  private $baseUrl = 'https://www.googleapis.com/';
  private $io;
  // apiServiceResource's that are used internally
  private $training;
  private $prediction;

  /**
   * Constructs the internal service representations and does the auto-magic configuration required to drive them
   */
  public function __construct(apiClient $apiClient) {
    $apiClient->addService('prediction', 'v1.1');
    $this->io = $apiClient->getIo();
    $this->training = new apiServiceResource($this, $this->serviceName, 'training', json_decode('{"methods":{"insert":{"pathUrl":"prediction\/v1.1\/training","rpcName":"prediction.training.insert","httpMethod":"POST","methodType":"rest","parameters":{"data":{"parameterType":"query","required":false}}},"delete":{"pathUrl":"prediction\/v1.1\/training\/{data}","rpcName":"prediction.training.delete","httpMethod":"DELETE","methodType":"rest","parameters":{"data":{"parameterType":"path","pattern":"[^\/]+","required":true}}},"get":{"pathUrl":"prediction\/v1.1\/training\/{data}","rpcName":"prediction.training.get","httpMethod":"GET","methodType":"rest","parameters":{"data":{"parameterType":"path","pattern":"[^\/]+","required":true}}}}}', true));
    $this->prediction = new apiServiceResource($this, $this->serviceName, 'prediction', json_decode('{"methods":{"predict":{"pathUrl":"prediction\/v1.1\/training\/{data}\/predict","rpcName":"prediction.predict","httpMethod":"POST","methodType":"rest","parameters":{"input":{"parameterType":"query","required":false},"data":{"parameterType":"path","pattern":"[^\/]+","required":true}}}}}', true));
  }

  /**
   * Implementation of the prediction.training.insert method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#prediction.training.insert
   *
   * @param $postBody required
   * @param $data optional
   */
  public function insertTraining($postBody, $data = null) {
    return $this->training->__call('insert', array(array('postBody' => $postBody, 'data' => $data)));
  }

  /**
   * Implementation of the prediction.training.delete method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#prediction.training.delete
   *
   * @param $data required
   */
  public function deleteTraining($data) {
    return $this->training->__call('delete', array(array('data' => $data)));
  }

  /**
   * Implementation of the prediction.training.get method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#prediction.training.get
   *
   * @param $data required
   */
  public function getTraining($data) {
    return $this->training->__call('get', array(array('data' => $data)));
  }

  /**
   * Implementation of the prediction.predict method.
   * See: http://code.google.com/apis/buzz/v1/using_rest.html#prediction.predict
   *
   * @param $data required
   * @param $postBody required
   * @param $input optional
   */
  public function predictPrediction($data, $postBody, $input = null) {
    return $this->prediction->__call('predict', array(array('data' => $data, 'postBody' => $postBody, 'input' => $input)));
  }

  /**
   * @return the $io
   */
  public function getIo() {
    return $this->io;
  }

  /**
   * @param $io the $io to set
   */
  public function setIo($io) {
    $this->io = $io;
  }

  /**
   * @return the $version
   */
  public function getVersion() {
    return $this->version;
  }

  /**
   * @return the $baseUrl
   */
  public function getBaseUrl() {
    return $this->baseUrl;
  }

  /**
   * @param $version the $version to set
   */
  public function setVersion($version) {
    $this->version = $version;
  }

  /**
   * @param $baseUrl the $baseUrl to set
   */
  public function setBaseUrl($baseUrl) {
    $this->baseUrl = $baseUrl;
  }
    
}

